home *** CD-ROM | disk | FTP | other *** search
/ Aminet 30 / Aminet 30 (1999)(Schatztruhe)[!][Apr 1999].iso / Aminet / dev / lang / SmallEiffel.lha / SmallEiffel / bin_c / compile_to_jvm37.c < prev    next >
C/C++ Source or Header  |  1998-12-22  |  18KB  |  833 lines

  1. /*
  2. -- ANSI C code generated by :
  3. -- SmallEiffel The GNU Eiffel Compiler -- Release (- 0.79)      --
  4. -- Copyright (C), 1994-98 - LORIA - UHP - CRIN - INRIA - FRANCE --
  5. -- Dominique COLNET and Suzanne COLLIN -    colnet@loria.fr     --
  6. --                 http://www.loria.fr/SmallEiffel              --
  7. */
  8. #include "compile_to_jvm.h"
  9.  
  10.  
  11. T0* r23at(T23* C,T0* a1){
  12. T0* R=NULL;
  13. T0* _to_key=NULL;
  14. _to_key=X50to_key(a1);
  15. /*[IF*/
  16. if(r333has((T333*)((C)->_feature_dictionary/*24*/),_to_key)){
  17. R=r333at((T333*)((C)->_feature_dictionary/*24*/),_to_key);
  18. }
  19. /*FI]*/
  20. return R;
  21. }
  22.  
  23.  
  24. T0* r23to_reference(T23* C){
  25. T0* R=NULL;
  26. R=r383at((T383*)(oBC23to_reference_memory),X52run_time_mark((C)->_current_type/*0*/));
  27. return R;
  28. }
  29. T0*oBC23ci_collector=NULL;
  30.  
  31.  
  32. T6 r23gt(T0* a1,T0* a2){
  33. T6 R=0;
  34. T0* _bcn2=NULL;
  35. T0* _bcn1=NULL;
  36. T0* _bf2=NULL;
  37. T0* _bf1=NULL;
  38. T0* _bc2=NULL;
  39. T0* _bc1=NULL;
  40. _bf1=(((T53*)a1))->_base_feature/*24*/;
  41. _bf2=(((T53*)a2))->_base_feature/*24*/;
  42. _bc1=/*X95base_class*/((T0*)(((T203*)_bf1))->_base_class/*4*/);
  43. _bc2=/*X95base_class*/((T0*)(((T203*)_bf2))->_base_class/*4*/);
  44. _bcn1=(((T63*)_bc1))->_name/*24*/;
  45. _bcn2=(((T63*)_bc2))->_name/*24*/;
  46. /*[IF*/
  47. if(((((T70*)_bcn1))->_to_string/*0*/)==((void*)((((T70*)_bcn2))->_to_string/*0*/))){
  48. R=r59before((T59*)(X95start_position(_bf1)),X95start_position(_bf2));
  49. }
  50.  else if(r70is_subclass_of(((T70*)_bcn2),_bcn1)){
  51. R=1;
  52. }
  53.  else if(r70is_subclass_of(((T70*)_bcn1),_bcn2)){
  54. }
  55.  else if(((((T63*)_bc1))->_parent_list/*40*/)==((void*)(NULL))){
  56. /*[IF*/
  57. if(((((T63*)_bc2))->_parent_list/*40*/)==((void*)(NULL))){
  58. R=r7_px_60((T7*)((((T70*)_bcn1))->_to_string/*0*/),(((T70*)_bcn2))->_to_string/*0*/);
  59. }
  60. else{
  61. R=1;
  62. }
  63. /*FI]*/
  64. }
  65.  else if(((((T63*)_bc2))->_parent_list/*40*/)==((void*)(NULL))){
  66. }
  67. else{
  68. R=(/*(IRF4.6count*/(((T83*)(((T81*)((((T63*)_bc2))->_parent_list/*40*/))->_list/*12*/)))->_upper/*8*//*)*/)<(/*(IRF4.6count*/(((T83*)(((T81*)((((T63*)_bc1))->_parent_list/*40*/))->_list/*12*/)))->_upper/*8*//*)*/);
  69. }
  70. /*FI]*/
  71. return R;
  72. }
  73.  
  74.  
  75. void r23opcode_checkcast(T23* C){
  76. T2 _idx=0;
  77. T0* _ct=NULL;
  78. _ct=(C)->_current_type/*0*/;
  79. /*[IF*/
  80. if(X52is_basic_eiffel_expanded(_ct)){
  81. }
  82.  else if(X52is_native_array(_ct)){
  83. /*[IRF3.3clear*/((((T7*)((T7*)(oBC23tmp_string))))->_count)=(0);
  84. /*]*/
  85. X52jvm_target_descriptor_in(_ct,oBC23tmp_string);
  86. _idx=r29idx_class2((T29*)(oBC12constant_pool),oBC23tmp_string);
  87. r28opcode_checkcast((T28*)(oBC12code_attribute),_idx);
  88. }
  89.  else if(X52is_bit(_ct)){
  90. }
  91. else{
  92. _idx=r23jvm_constant_pool_index(C);
  93. r28opcode_checkcast((T28*)(oBC12code_attribute),_idx);
  94. }
  95. /*FI]*/
  96. }
  97. /*No:RUN_CLASS.us_item*/
  98.  
  99.  
  100. T0* r23get_copy(T23* C){
  101. T0* R=NULL;
  102. R=r23get_rf_with(C,/*X95first_name*/((T0*)/*(IRF4.6first_name*/r87item(((T87*)(((T203*)(r63get_copy((T63*)(r23class_general()))))->_names/*8*/)),1)/*)*/));
  103. return R;
  104. }
  105.  
  106.  
  107. void r23runnable_class_invariant(T23* C){
  108. T0* _r=NULL;
  109. /*[IF*/
  110. if(!((C)->_runnable_class_invariant_done/*28*/)){
  111. C->_runnable_class_invariant_done=1;
  112. /*[IF*/
  113. if(r76invariant_check((T76*)(oBC12run_control))){
  114. /*[IF*/
  115. if((C)->_at_run_time/*8*/){
  116. r108clear((T108*)(oBC23ci_collector));
  117. r63collect_invariant((T63*)(r23base_class(C)),(T0*)C);
  118. _r=r23runnable(oBC23ci_collector,(C)->_current_type/*0*/,NULL);
  119. /*[IF*/
  120. if((_r)!=((void*)(NULL))){
  121. r22incr_magic_count((T22*)(oBC12small_eiffel));
  122. {T106*n=malloc(sizeof(*n));
  123. *n=M106;
  124. r106make_runnable(n,_r,(C)->_current_type/*0*/,NULL);
  125. C->_class_invariant=(T0*)n;
  126. }
  127. }
  128. /*FI]*/
  129. }
  130. /*FI]*/
  131. }
  132. /*FI]*/
  133. }
  134. /*FI]*/
  135. }
  136.  
  137.  
  138. void r23jvm_expanded_push_default(T23* C){
  139. T0* _rf=NULL;
  140. r23jvm_basic_new(C);
  141. _rf=r63expanded_initializer((T63*)(r23base_class(C)),(C)->_current_type/*0*/);
  142. /*[IF*/
  143. if((_rf)!=((void*)(NULL))){
  144. r24push_expanded_initialize((T24*)(oBC12jvm),_rf);
  145. X27mapping_jvm(_rf);
  146. r24pop((T24*)(oBC12jvm));
  147. }
  148. /*FI]*/
  149. }
  150.  
  151.  
  152. void r23set_at_run_time(T23* C){
  153. T2 _i=0;
  154. T0* _rc=NULL;
  155. T0* _rcd=NULL;
  156. /*[IF*/
  157. if(!((C)->_at_run_time/*8*/)){
  158. C->_at_run_time=1;
  159. C->_compile_to_c_done=0;
  160. C->_runnable_class_invariant_done=0;
  161. r23add_running(C,(T0*)C);
  162. r22incr_magic_count((T22*)(oBC12small_eiffel));
  163. /*[IF*/
  164. if(X52is_reference((C)->_current_type/*0*/)){
  165. _rcd=oBC22run_class_dictionary;
  166. _i=1;
  167. while (!((_i)>((((T342*)_rcd))->_count/*36*/))) {
  168. _rc=r342item(((T342*)_rcd),_i);
  169. /*[IF*/
  170. if(r23is_running_of(C,_rc)){
  171. r23add_running(((T23*)_rc),(T0*)C);
  172. }
  173. /*FI]*/
  174. _i=(_i)+(1);
  175. }
  176. }
  177. /*FI]*/
  178. }
  179. /*FI]*/
  180. }
  181. /*No:RUN_CLASS.fatal_error*/
  182. /*No:RUN_CLASS.collect_invariant*/
  183. /*No:RUN_CLASS.us_general*/
  184. /*No:RUN_CLASS.set_strip_used*/
  185.  
  186.  
  187. T0* r23get_rf_with(T23* C,T0* a1){
  188. T0* R=NULL;
  189. T0* _wbc=NULL;
  190. T0* _fn2=NULL;
  191. _wbc=r59base_class((T59*)(X50start_position(a1)));
  192. _fn2=r63new_name_of((T63*)(r23base_class(C)),_wbc,a1);
  193. /*[IF*/
  194. if((_fn2)!=((void*)(a1))){
  195. r21add_position(X50start_position(a1));
  196. R=r23get_or_fatal_error(C,_fn2);
  197. /*[IRF3.2cancel*//*[IRF3.3clear*/((((T7*)((T7*)(oBC21explanation))))->_count)=(0);
  198. /*]*/
  199. /*[IRF3.3clear*/((((T58*)((T58*)(oBC21positions))))->_upper)=(-(1));
  200. /*]*/
  201. /*]*/
  202. }
  203. else{
  204. R=r23get_or_fatal_error(C,_fn2);
  205. }
  206. /*FI]*/
  207. return R;
  208. }
  209. /*No:RUN_CLASS.current_type*/
  210. /*No:RUN_CLASS.fz_bad_assertion*/
  211.  
  212.  
  213. T0* r23class_with(T0* a1){
  214. T0* R=NULL;
  215. R=r22get_class(a1);
  216. return R;
  217. }
  218.  
  219.  
  220. void r23add_running(T23* C,T0* a1){
  221. /*[IF*/
  222. if(((C)->_running/*12*/)==((void*)(NULL))){
  223. C->_running=se_ma340(1,
  224. a1);
  225. }
  226. else{
  227. /*[IF*/
  228. if(!(r340fast_has((T340*)((C)->_running/*12*/),a1))){
  229. r340add_last((T340*)((C)->_running/*12*/),a1);
  230. }
  231. /*FI]*/
  232. }
  233. /*FI]*/
  234. }
  235.  
  236.  
  237. void r23add_client(T23* C,T0* a1){
  238. T2 _i=0;
  239. _i=r343fast_index_of((T343*)((C)->_actuals_clients/*40*/),a1);
  240. /*[IF*/
  241. if((_i)>(((T343*)((C)->_actuals_clients/*40*/))->_upper/*8*/)){
  242. r343add_last((T343*)((C)->_actuals_clients/*40*/),a1);
  243. }
  244. /*FI]*/
  245. }
  246. /*No:RUN_CLASS.fz_dot*/
  247. /*No:RUN_CLASS.compile_to_c_done*/
  248.  
  249.  
  250. void r23error(T0* a1,T0* a2){
  251. r21add_position(a1);
  252. r21error((T21*)(oBC12eh),a2);
  253. }
  254. /*No:RUN_CLASS.class_invariant*/
  255.  
  256.  
  257. void r23make(T23* C,T0* a1){
  258. T2 _i=0;
  259. T0* _rc=NULL;
  260. T0* _rcd=NULL;
  261. T0* _run_string=NULL;
  262. C->_compile_to_c_done=1;
  263. C->_current_type=a1;
  264. {T343*n=malloc(sizeof(*n));
  265. *n=M343;
  266. r343with_capacity(n,16);
  267. C->_actuals_clients=(T0*)n;
  268. }
  269. _run_string=X52run_time_mark(a1);
  270. C->_id=r104item((T104*)(r23id_provider()),_run_string);
  271. r342put((T342*)(oBC22run_class_dictionary),(T0*)C,_run_string);
  272. {T333*n=malloc(sizeof(*n));
  273. *n=M333;
  274. /*[IRF3.4make*/r333with_capacity(n,32);
  275. /*]*/
  276. C->_feature_dictionary=(T0*)n;
  277. }
  278. r22incr_magic_count((T22*)(oBC12small_eiffel));
  279. /*[IF*/
  280. if(X52is_expanded(a1)){
  281. r23set_at_run_time(C);
  282. r63check_expanded_with((T63*)(X52base_class(a1)),a1);
  283. }
  284. else{
  285. _rcd=oBC22run_class_dictionary;
  286. _i=1;
  287. while (!((_i)>((((T342*)_rcd))->_count/*36*/))) {
  288. _rc=r342item(((T342*)_rcd),_i);
  289. /*[IF*/
  290. if((((((T23*)_rc))->_at_run_time/*8*/)&&(X52is_reference((((T23*)_rc))->_current_type/*0*/)))&&(r23is_running_of(((T23*)_rc),(T0*)C))){
  291. r23add_running(C,_rc);
  292. }
  293. /*FI]*/
  294. _i=(_i)+(1);
  295. }
  296. }
  297. /*FI]*/
  298. }
  299. int fBC12id_provider=0;
  300. T0*oBC12id_provider=NULL;
  301.  
  302.  
  303. T0* r23id_provider(void){
  304. if(fBC12id_provider==0){
  305. fBC12id_provider=1;
  306. {T104*n=malloc(sizeof(*n));
  307. *n=M104;
  308. r104make(n);
  309. oBC12id_provider=(T0*)n;
  310. }
  311. }
  312. return oBC12id_provider;}
  313.  
  314.  
  315. void r23efnf(T23* C,T0* a1,T0* a2){
  316. /*[IRF3.6append*/{T0* b1=((T0*)ms23_16640);
  317. r7append((T7*)(oBC21explanation),b1);
  318. }/*]*/
  319. /*[IRF3.6append*/{T0* b1=X52run_time_mark((C)->_current_type/*0*/);
  320. r7append((T7*)(oBC21explanation),b1);
  321. }/*]*/
  322. /*[IRF3.6append*/{T0* b1=((T0*)ms23_23892);
  323. r7append((T7*)(oBC21explanation),b1);
  324. }/*]*/
  325. /*[IRF3.6append*/{T0* b1=X50to_string(a2);
  326. r7append((T7*)(oBC21explanation),b1);
  327. }/*]*/
  328. /*[IRF3.6append*/{T0* b1=((T0*)ms23_7130);
  329. r7append((T7*)(oBC21explanation),b1);
  330. }/*]*/
  331. /*[IRF3.6append*/{T0* b1=((T70*)((((T63*)a1))->_name/*24*/))->_to_string/*0*/;
  332. r7append((T7*)(oBC21explanation),b1);
  333. }/*]*/
  334. r23error(X50start_position(a2),((T0*)ms13_47));
  335. }
  336.  
  337.  
  338. T0* r23get_result_type(T23* C,T0* a1){
  339. T0* R=NULL;
  340. T0* _bc=NULL;
  341. T0* _f=NULL;
  342. T0* _fn2_key=NULL;
  343. T0* _rf=NULL;
  344. T0* _wbc=NULL;
  345. T0* _fn2=NULL;
  346. _wbc=r59base_class((T59*)(X50start_position(a1)));
  347. _fn2=r63new_name_of((T63*)(r23base_class(C)),_wbc,a1);
  348. _fn2_key=X50to_key(_fn2);
  349. /*[IF*/
  350. if(r333has((T333*)((C)->_feature_dictionary/*24*/),_fn2_key)){
  351. _rf=r333at((T333*)((C)->_feature_dictionary/*24*/),_fn2_key);
  352. R=X27result_type(_rf);
  353. /*[IF*/
  354. if(X52is_run_type(R)){
  355. R=X52run_type(R);
  356. }
  357. else{
  358. R=X52to_runnable(R,(C)->_current_type/*0*/);
  359. R=X52run_type(R);
  360. }
  361. /*FI]*/
  362. }
  363. else{
  364. _bc=r23base_class(C);
  365. _f=r63look_up_for(((T63*)_bc),(T0*)C,_fn2);
  366. /*[IF*/
  367. if((_f)==((void*)(NULL))){
  368. r23efnf(C,_bc,_fn2);
  369. r21add_position(X50start_position(a1));
  370. r21add_position(X50start_position(_fn2));
  371. /*[IRF3.6fatal_error*/{T0* b1=((T0*)ms23_22554);
  372. r21fatal_error((T21*)(oBC12eh),b1);
  373. }/*]*/
  374. }
  375. else{
  376. R=X95result_type(_f);
  377. /*[IF*/
  378. if((R)==((void*)(NULL))){
  379. r21add_position(X95start_position(_f));
  380. r21add_position(X50start_position(a1));
  381. r21add_position(X50start_position(_fn2));
  382. /*[IRF3.6fatal_error*/{T0* b1=((T0*)ms23_51011);
  383. r21fatal_error((T21*)(oBC12eh),b1);
  384. }/*]*/
  385. }
  386. else{
  387. R=X52to_runnable(R,(C)->_current_type/*0*/);
  388. R=X52run_type(R);
  389. }
  390. /*FI]*/
  391. }
  392. /*FI]*/
  393. }
  394. /*FI]*/
  395. return R;
  396. }
  397. T0*oBC23tmp_string=NULL;
  398.  
  399.  
  400. void r23afd_check(T23* C){
  401. T0* _rt=NULL;
  402. T0* _rc=NULL;
  403. T2 _i=0;
  404. T0* _rf=NULL;
  405. r23runnable_class_invariant(C);
  406. _i=1;
  407. while (!((_i)>(((T333*)((C)->_feature_dictionary/*24*/))->_count/*36*/))) {
  408. _rf=r333item((T333*)((C)->_feature_dictionary/*24*/),_i);
  409. X27afd_check(_rf);
  410. _rt=X27result_type(_rf);
  411. /*[IF*/
  412. if((_rt)!=((void*)(NULL))){
  413. /*[IF*/
  414. if(X52is_none(_rt)){
  415. }
  416. else{
  417. _rc=X52run_class(_rt);
  418. }
  419. /*FI]*/
  420. }
  421. /*FI]*/
  422. _i=(_i)+(1);
  423. }
  424. /*[IF*/
  425. if(((C)->_class_invariant/*16*/)!=((void*)(NULL))){
  426. r106afd_check((T106*)((C)->_class_invariant/*16*/));
  427. }
  428. /*FI]*/
  429. }
  430.  
  431.  
  432. T0* r23get_feature_with(T23* C,T0* a1){
  433. T0* R=NULL;
  434. T0* _sfn=NULL;
  435. /*[IF*/
  436. if(r333has((T333*)((C)->_feature_dictionary/*24*/),a1)){
  437. R=r333at((T333*)((C)->_feature_dictionary/*24*/),a1);
  438. }
  439. else{
  440. {T151*n=malloc(sizeof(*n));
  441. *n=M151;
  442. r151make(n,a1,NULL);
  443. _sfn=(T0*)n;
  444. }
  445. R=r23get_feature(C,_sfn);
  446. }
  447. /*FI]*/
  448. return R;
  449. }
  450.  
  451.  
  452. T0* r23base_class(T23* C){
  453. T0* R=NULL;
  454. R=X52base_class((C)->_current_type/*0*/);
  455. return R;
  456. }
  457. /*No:RUN_CLASS.actuals_clients*/
  458.  
  459.  
  460. T0* r23get_or_fatal_error(T23* C,T0* a1){
  461. T0* R=NULL;
  462. R=r23get_feature(C,a1);
  463. /*[IF*/
  464. if((R)==((void*)(NULL))){
  465. r21add_position(X50start_position(a1));
  466. /*[IRF3.6append*/{T0* b1=((T0*)ms23_6176);
  467. r7append((T7*)(oBC21explanation),b1);
  468. }/*]*/
  469. /*[IRF3.6append*/{T0* b1=X50to_string(a1);
  470. r7append((T7*)(oBC21explanation),b1);
  471. }/*]*/
  472. /*[IRF3.6append*/{T0* b1=((T0*)ms23_62016);
  473. r7append((T7*)(oBC21explanation),b1);
  474. }/*]*/
  475. r21add_type((C)->_current_type/*0*/,((T0*)ms13_47));
  476. r21print_as_fatal_error((T21*)(oBC12eh));
  477. }
  478. /*FI]*/
  479. return R;
  480. }
  481. /*No:RUN_CLASS.running*/
  482.  
  483.  
  484. T0* r23runnable(T0* a1,T0* a2,T0* a3){
  485. T0* R=NULL;
  486. T0* _a=NULL;
  487. T2 _i=0;
  488. /*[IF*/
  489. if(!(r108empty(((T108*)a1)))){
  490. R=r108twin(((T108*)a1));
  491. _i=(((T108*)R))->_upper/*8*/;
  492. while (!((_i)==(0))) {
  493. r22push((T22*)(oBC12small_eiffel),a3);
  494. _a=r105to_runnable((T105*)(r108item(((T108*)R),_i)),a2);
  495. /*[IF*/
  496. if((_a)==((void*)(NULL))){
  497. r23error(r105start_position((T105*)(r108item(((T108*)R),_i))),((T0*)ms13_14266));
  498. }
  499. else{
  500. /*[IRF3.6put*/{T108* C1=((T108*)R);
  501. T0* b1=_a;
  502. T2 b2=_i;
  503. ((C1)->_storage/*0*/)[(b2)-((C1)->_lower/*12*/)]=(b1);
  504. }/*]*/
  505. }
  506. /*FI]*/
  507. r22pop((T22*)(oBC12small_eiffel));
  508. _i=(_i)-(1);
  509. }
  510. }
  511. /*FI]*/
  512. return R;
  513. }
  514.  
  515.  
  516. void r23jvm_invoke(T23* C,T2 a1,T2 a2){
  517. T0* _ct=NULL;
  518. _ct=(C)->_current_type/*0*/;
  519. {int z1=X52jvm_method_flags(_ct);
  520.  
  521. if((17==z1)){
  522. r28opcode_invokevirtual((T28*)(oBC12code_attribute),a1,a2);
  523. }
  524.  else {r28opcode_invokestatic((T28*)(oBC12code_attribute),a1,a2);
  525. }}
  526. }
  527.  
  528.  
  529. void r23jvm_to_reference(T23* C){
  530. T0* _ref_type=NULL;
  531. _ref_type=r23to_reference(C);
  532. r23jvm_reference_from((T23*)(X52run_class(_ref_type)),(C)->_current_type/*0*/);
  533. }
  534. /*No:RUN_CLASS.fz_invariant*/
  535.  
  536.  
  537. void r23jvm_type_descriptor_in(T23* C,T0* a1){
  538. r7extend(((T7*)a1),'L');
  539. r7append(((T7*)a1),r23fully_qualified_name(C));
  540. r7extend(((T7*)a1),'\73');
  541. }
  542.  
  543.  
  544. void r23jvm_basic_new(T23* C){
  545. T0* _cp=NULL;
  546. T0* _ca=NULL;
  547. T0* _t2=NULL;
  548. T0* _rf2=NULL;
  549. T0* _wa=NULL;
  550. T2 _idx=0;
  551. T2 _i=0;
  552. _ca=oBC12code_attribute;
  553. _cp=oBC12constant_pool;
  554. _idx=r23jvm_constant_pool_index(C);
  555. r28opcode_new(((T28*)_ca),_idx);
  556. /*[IRF3.4opcode_dup*/r28opcode(((T28*)_ca),89,1);
  557. /*]*/
  558. _idx=r29idx_methodref1(((T29*)_cp),_idx,((T0*)ms13_5298),((T0*)ms13_519));
  559. r28opcode_invokespecial(((T28*)_ca),_idx,-(1));
  560. _wa=r23writable_attributes(C);
  561. /*[IF*/
  562. if((_wa)!=((void*)(NULL))){
  563. _i=(((T54*)_wa))->_upper/*12*/;
  564. while (!((_i)==(0))) {
  565. _rf2=r54item(((T54*)_wa),_i);
  566. _t2=X52run_type((((T53*)_rf2))->_result_type/*28*/);
  567. /*[IF*/
  568. if(X52is_user_expanded(_t2)){
  569. /*[IRF3.4opcode_dup*/r28opcode(((T28*)_ca),89,1);
  570. /*]*/
  571. r23jvm_expanded_push_default((T23*)(X52run_class(_t2)));
  572. _idx=r29idx_fieldref(((T29*)_cp),_rf2);
  573. r28opcode_putfield(((T28*)_ca),_idx,-(2));
  574. }
  575.  else if(X52is_bit(_t2)){
  576. /*[IRF3.4opcode_dup*/r28opcode(((T28*)_ca),89,1);
  577. /*]*/
  578. _idx=X52jvm_push_default(_t2);
  579. _idx=r29idx_fieldref(((T29*)_cp),_rf2);
  580. r28opcode_putfield(((T28*)_ca),_idx,-(2));
  581. }
  582. /*FI]*/
  583. _i=(_i)-(1);
  584. }
  585. }
  586. /*FI]*/
  587. }
  588. /*No:RUN_CLASS.at_run_time*/
  589.  
  590.  
  591. T0* r23dynamic(T23* C,T0* a1){
  592. T0* R=NULL;
  593. T0* _up_type=NULL;
  594. T0* _up_fn=NULL;
  595. T0* _fn=NULL;
  596. _up_type=/*X27current_type*/((T0*)(((T26*)a1))->_current_type/*4*/);
  597. /*[IF*/
  598. if((C)==((void*)(X52run_class(_up_type)))){
  599. R=a1;
  600. }
  601. else{
  602. _up_fn=/*X27name*/((T0*)(((T26*)a1))->_name/*16*/);
  603. _fn=r63new_name_of((T63*)(r23base_class(C)),X52base_class(_up_type),_up_fn);
  604. R=r23get_or_fatal_error(C,_fn);
  605. }
  606. /*FI]*/
  607. return R;
  608. }
  609. /*No:RUN_CLASS.fz_35*/
  610. /*No:RUN_CLASS.add_rf*/
  611. T0*oBC23fully_qualified_name_memory2=NULL;
  612. /*No:RUN_CLASS.runnable_class_invariant_done*/
  613.  
  614.  
  615. void r23compile_to_jvm(T23* C){
  616. T0* _type_ref_to_exp=NULL;
  617. T0* _rf=NULL;
  618. T2 _i=0;
  619. r31put_character((T31*)(oBC12echo),'\11');
  620. r31put_string((T31*)(oBC12echo),X52run_time_mark((C)->_current_type/*0*/));
  621. r31put_character((T31*)(oBC12echo),'\n');
  622. r24start_new_class((T24*)(oBC12jvm),(T0*)C);
  623. _i=1;
  624. while (!((_i)>(((T333*)((C)->_feature_dictionary/*24*/))->_count/*36*/))) {
  625. _rf=r333item((T333*)((C)->_feature_dictionary/*24*/),_i);
  626. /*[IRF3.3set_current_frame*/((((T24*)((T24*)(oBC12jvm))))->_current_frame)=(_rf);
  627. /*]*/
  628. X27jvm_field_or_method(_rf);
  629. _i=(_i)+(1);
  630. }
  631. _type_ref_to_exp=(C)->_current_type/*0*/;
  632. if(NULL!=(_type_ref_to_exp))switch(((T0*)_type_ref_to_exp)->id) {
  633. case 354: 
  634. break;
  635. default:
  636. _type_ref_to_exp=NULL;
  637. };/*[IF*/
  638. if((_type_ref_to_exp)==((void*)(NULL))){
  639. /*[IRF3.2prepare_fields*/{T0* _rf=NULL;
  640. T2 _i=0;
  641. _i=/*X55upper*/((T2)((T55*)(oBC24fields))->_upper/*12*/);
  642. while (!((_i)<(0))) {
  643. _rf=/*X55item*/((T0*)r55item((T55*)(oBC24fields),_i));
  644. X27jvm_define(_rf);
  645. _i=(_i)-(1);
  646. }
  647. }/*]*/
  648. }
  649. else{
  650. r354jvm_prepare_item_field(((T354*)_type_ref_to_exp));
  651. }
  652. /*FI]*/
  653. r24prepare_methods((T24*)(oBC12jvm));
  654. r24finish_class((T24*)(oBC12jvm));
  655. }
  656. /*No:RUN_CLASS.fz_29*/
  657. /*No:RUN_CLASS.nb_errors*/
  658. T0*oBC23unqualified_name_memory=NULL;
  659.  
  660.  
  661. T2 r23jvm_constant_pool_index(T23* C){
  662. T2 R=0;
  663. R=r29idx_class2((T29*)(oBC12constant_pool),r23fully_qualified_name(C));
  664. return R;
  665. }
  666. /*No:RUN_CLASS.feature_dictionary*/
  667.  
  668.  
  669. void r23store_feature(T23* C,T0* a1){
  670. T0* _rf_key=NULL;
  671. _rf_key=X50to_key(/*X27name*/((T0*)(((T26*)a1))->_name/*16*/));
  672. /*[IF*/
  673. if(r333has((T333*)((C)->_feature_dictionary/*24*/),_rf_key)){
  674. }
  675. else{
  676. r333put((T333*)((C)->_feature_dictionary/*24*/),a1,_rf_key);
  677. r22incr_magic_count((T22*)(oBC12small_eiffel));
  678. }
  679. /*FI]*/
  680. }
  681. /*No:RUN_CLASS.fully_qualified_name_memory*/
  682.  
  683.  
  684. T6 r23is_running_of(T23* C,T0* a1){
  685. T6 R=0;
  686. T0* _t2=NULL;
  687. T0* _t1=NULL;
  688. /*[IF*/
  689. if((a1)==((void*)(C))){
  690. R=1;
  691. }
  692. else{
  693. _t1=(C)->_current_type/*0*/;
  694. _t2=(((T23*)a1))->_current_type/*0*/;
  695. /*[IF*/
  696. if((X52is_basic_eiffel_expanded(_t1))&&(X52is_basic_eiffel_expanded(_t2))){
  697. }
  698. else{
  699. R=X52is_a(_t1,_t2);
  700. /*[IF*/
  701. if(!(R)){
  702. /*[IRF3.2cancel*//*[IRF3.3clear*/((((T7*)((T7*)(oBC21explanation))))->_count)=(0);
  703. /*]*/
  704. /*[IRF3.3clear*/((((T58*)((T58*)(oBC21positions))))->_upper)=(-(1));
  705. /*]*/
  706. /*]*/
  707. }
  708. /*FI]*/
  709. }
  710. /*FI]*/
  711. }
  712. /*FI]*/
  713. return R;
  714. }
  715.  
  716.  
  717. void r23prepare_strip(T23* C){
  718. T2 _i=0;
  719. T0* _rf2=NULL;
  720. /*[IF*/
  721. if((C)->_strip_used/*32*/){
  722. _i=1;
  723. while (!((_i)>(((T333*)((C)->_feature_dictionary/*24*/))->_count/*36*/))) {
  724. _rf2=r333item((T333*)((C)->_feature_dictionary/*24*/),_i);
  725. if(NULL!=(_rf2))switch(((T0*)_rf2)->id) {
  726. case 53: 
  727. break;
  728. default:
  729. _rf2=NULL;
  730. };/*[IF*/
  731. if((_rf2)!=((void*)(NULL))){
  732. X52used_as_reference((((T53*)_rf2))->_result_type/*28*/);
  733. }
  734. /*FI]*/
  735. _i=(_i)+(1);
  736. }
  737. }
  738. /*FI]*/
  739. }
  740.  
  741.  
  742. T0* r23fully_qualified_name(T23* C){
  743. T0* R=NULL;
  744. /*[IF*/
  745. if(((C)->_fully_qualified_name_memory/*36*/)==((void*)(NULL))){
  746. r7copy((T7*)(oBC23fully_qualified_name_memory2),((T24*)(oBC12jvm))->_output_name/*0*/);
  747. r7extend((T7*)(oBC23fully_qualified_name_memory2),'\57');
  748. r7append((T7*)(oBC23fully_qualified_name_memory2),r23unqualified_name(C));
  749. {T7*n=malloc(sizeof(*n));
  750. *n=M7;
  751. r7copy(n,oBC23fully_qualified_name_memory2);
  752. C->_fully_qualified_name_memory=(T0*)n;
  753. }
  754. }
  755. /*FI]*/
  756. R=(C)->_fully_qualified_name_memory/*36*/;
  757. return R;
  758. }
  759.  
  760.  
  761. void r23sort_wam(T0* a1){
  762. T6 _moved=0;
  763. T2 _buble=0;
  764. T2 _max=0;
  765. T2 _min=0;
  766. _max=(((T54*)a1))->_upper/*12*/;
  767. _min=1;
  768. _moved=1;
  769. while (!(!(_moved))) {
  770. _moved=0;
  771. /*[IF*/
  772. if(((_max)-(_min))>(0)){
  773. _buble=(_min)+(1);
  774. while (!((_buble)>(_max))) {
  775. /*[IF*/
  776. if(r23gt(r54item(((T54*)a1),(_buble)-(1)),r54item(((T54*)a1),_buble))){
  777. r54swap(((T54*)a1),(_buble)-(1),_buble);
  778. _moved=1;
  779. }
  780. /*FI]*/
  781. _buble=(_buble)+(1);
  782. }
  783. _max=(_max)-(1);
  784. }
  785. /*FI]*/
  786. /*[IF*/
  787. if((_moved)&&(((_max)-(_min))>(0))){
  788. _moved=0;
  789. _buble=(_max)-(1);
  790. while (!((_buble)<(_min))) {
  791. /*[IF*/
  792. if(r23gt(r54item(((T54*)a1),_buble),r54item(((T54*)a1),(_buble)+(1)))){
  793. r54swap(((T54*)a1),_buble,(_buble)+(1));
  794. _moved=1;
  795. }
  796. /*FI]*/
  797. _buble=(_buble)-(1);
  798. }
  799. _min=(_min)+(1);
  800. }
  801. /*FI]*/
  802. }
  803. }
  804.  
  805.  
  806. void r23falling_down(T23* C){
  807. T2 _i=0;
  808. T0* _rf=NULL;
  809. _i=1;
  810. while (!((_i)>(((T333*)((C)->_feature_dictionary/*24*/))->_count/*36*/))) {
  811. _rf=r333item((T333*)((C)->_feature_dictionary/*24*/),_i);
  812. X27fall_down(_rf);
  813. _i=(_i)+(1);
  814. }
  815. r23prepare_strip(C);
  816. }
  817.  
  818.  
  819. void r23jvm_define_class_invariant(T23* C){
  820. T0* _ia=NULL;
  821. /*[IF*/
  822. if(r76invariant_check((T76*)(oBC12run_control))){
  823. _ia=(C)->_class_invariant/*16*/;
  824. /*[IF*/
  825. if((_ia)!=((void*)(NULL))){
  826. r24define_class_invariant_method((T24*)(oBC12jvm),_ia);
  827. }
  828. /*FI]*/
  829. }
  830. /*FI]*/
  831. }
  832.  
  833.